package com.sevencar.activity;


import org.json.JSONException;
import org.json.JSONObject;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.sevencar.R;
import com.sevencar.json.JsonParser;
import com.sevencar.util.Config;
import com.sevencar.util.Log;

public class ProductAddActivity extends BaseActivity {

	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_add_product);
		
		Button submit = (Button)findViewById(R.id.button1);
		submit.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				
				new Thread(){
					public void run(){
						String resultStr = "";
						JSONObject resultJSON;
						String result = "";
						String msgStr = "";
						try {
							String report_num = "";
							String report_context= "";
							String report_img_names= "";
							String report_user= "";
							String phone_number= "";
							String report_time= "";
							String report_yyy= "";
							String report_xxx= "";
							String report_station= "";
							msgStr = "{'submitReport':{'report_num':'"+report_num+
										"','report_context':'"+report_context+"','report_img_name':'"+report_img_names+"','report_user':'"+report_user+"','phone_number':'"+phone_number+"','report_time':'"+report_time+"','yyy':'"+report_yyy+"','xxx':'"+report_xxx+"','report_station':'"+report_station+"'},'token':'"+Config.token+"'}";
							resultStr = JsonParser.getResponse(Config.base_url, msgStr);
							Log.log("resultStr is  "+resultStr);
							if(resultStr.equals("")){
							}else{
								resultJSON = new JSONObject(resultStr);
								result = resultJSON.getString("result");
								if(result.equals("ok")){
								}else if(result.equals("error")){
								}
							}
						} catch (JSONException e) {
							e.printStackTrace();
						}
					}
				}.start();
				
			}
		});
	}
}
